package com.example.gsp.mybatis.session;

import com.example.gsp.mybatis.config.Configuration;

import java.sql.Connection;
import java.util.List;

public interface SqlSession {

    <T> T selectOne(String statement);


    <T> T selectOne(String statement, Object parameter);

    <E> List<E> selectList(String statement);


    <E> List<E> selectList(String statement, Object parameter);

    int insert(String statement);

    int insert(String statement, Object parameter);

    int update(String statement);

    int update(String statement, Object parameter);

    int delete(String statement);

    int delete(String statement, Object parameter);

    void commit();

    void commit(boolean force);

    void rollback();

    void rollback(boolean force);

    void close();


    void clearCache();

    Configuration getConfiguration();

    <T> T getMapper(Class<T> type);

    Connection getConnection();
}
